#include <iostream>
#include "d_Math.h"

using namespace d_Math;

d_Vec4f::d_Vec4f()
{
	p[0] = p[1] = p[2] = p[3] = 0;
}

d_Vec4f::d_Vec4f(float x, float y, float z, float w)
{
	p[0] = x; p[1] = y; p[2] = z; p[3] = w;
}

d_Vec4f::d_Vec4f(float v[])
{
	p[0] = v[0]; p[1] = v[1]; p[2] = v[2]; p[3] = v[3];
}

d_Vec4f::d_Vec4f(const d_Vec4f &v)
{
	p[0] = v[0];
	p[1] = v[1];
	p[2] = v[2];
	p[3] = v[3];
}

void d_Vec4f::print()
{
	std::cout << "[" << p[0] << "," << p[1] << "," << p[2] << "," << p[3] << "]";
}

d_Vec4f d_Vec4f::operator + (const d_Vec4f v) const
{
	return d_Vec4f(p[0]+v[0], p[1]+v[1], p[2]+v[2], p[3]+v[3]);
}

d_Vec4f d_Vec4f::operator - (const d_Vec4f v) const
{
	return d_Vec4f(p[0]-v[0], p[1]-v[1], p[2]-v[2], p[3]-v[3]);
}

d_Vec4f d_Vec4f::operator * (const float a) const
{
	return d_Vec4f(p[0]*a, p[1]*a, p[2]*a, p[3]*a);
}

d_Vec4f d_Vec4f::operator / (const float a) const
{
	return d_Vec4f(p[0]/a, p[1]/a, p[2]/a, p[3]/a);
}


